<?php
	require_once('./config.php');
	
	//into page
	$action = isset($_GET['p']) ? $_GET['p'] : 'index';
	if (file_exists(THEMEPATH.$action.'.php')) 
	{
		include(THEMEPATH.'header.php');
		include(THEMEPATH.$action.'.php');
		include(THEMEPATH.'sidebar.php');
		include(THEMEPATH.'footer.php');
	}
	else
	{
		include(THEMEPATH.'404.php');
	}
	
?>